Modern Fortran: Building efficient parallel applications by Milan Curcic

Modern Fortran: Building efficient parallel applications by Milan Curcic

Author:Milan Curcic [Curcic, Milan]
Language: eng
Format: epub
Publisher: Manning Publications Co.
Published: 0101-01-01T00:00:00+00:00


7.4.4 Controlling the order of image execution

When executing the program on multiple images, there’s no imposed order in which the images execute--they all run at their own pace and independently from each other.

Any program that requires an exchange of data between processors will also require synchronization at one or more times during the calculation. This is true of the tsunami simulator as well! If image 2 needs data from image 1, it’s important that image 1 send that data before it updates it with the solution in the next iteration. This is where Fortran’s sync statement comes in. sync is used to request synchronization between any or all parallel images. The most basic form of the sync statement is sync all--synchronize all images. sync all basically states that no image will go past this point until all other images have arrived (figure 7.8).



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.